package com.testing.sqlUtil;

import java.sql.SQLException;
import java.util.Map;

/**
 * @Classname MysqlUtilTest
 * @Description 类型说明
 * @Date 2021/1/5 22:07
 * @Created by 特斯汀Roy
 */
public class MysqlUtilTest {
    public static void main(String[] args)  {
        MysqlUtils roy=new MysqlUtils();
        roy.createConnector();
        Map<String, String> userinfoMap = roy.getUserinfo("Roy");
        String jsonResult="{";
        for(String key:userinfoMap.keySet()){
            //用户名密码不返回
            if(!key.equals("password")&&!key.equals("username")){
                jsonResult+= "\""+key+"\":\""+userinfoMap.get(key)+"\",";
            }
        }
        jsonResult+="}";
        jsonResult=jsonResult.replaceAll(",}","}");
        System.out.println(jsonResult);
    }
}
